<?php if ($fieldname == $sort[0]): ?>
<?php echo link_to(__($fieldlabel, array(), 'messages'), $routename, array('query_string' => 'sort='. $fieldname .'&sort_type=' . ($sort[1] == 'asc' ? 'desc' : 'asc'))) ?>
<?php echo image_tag(sfConfig::get('sf_admin_module_web_dir') . '/images/' . $sort[1] . '.png', array('alt' => __($sort[1], array(), 'sf_admin'), 'title' => __($sort[1], array(), 'sf_admin'))) ?>
<?php else: ?>
<?php echo link_to(__($fieldlabel, array(), 'messages'), $routename, array('query_string' => 'sort='. $fieldname .'&sort_type=asc')) ?>
<?php endif; ?>
